
function post (url, data, callback_success, callback_error) {

    $.ajax({
        type:'post',
        url : url,
        data: data,
        success: (res) => {

            if (res.code == 0) {
                layui.msg(res.info, {icon: 2})
            } else {
                typeof callback_success === 'function' && callback_success(res)

            }

        },
    })
}

function get (url, data, callback_success, callback_error) {

    $.ajax({
        type:'get',
        url : url,
        data: data,
        success: (res) => {

            if (res.code == 0) {
                layui.msg(res.info, {icon: 2})
            } else {
                typeof callback_success === 'function' && callback_success(res)

            }

        },
    })
}